package com.hqj.demo.service;

import com.hqj.demo.dao.AdminDao;
import com.hqj.demo.entity.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class AdminServiceI implements AdminService {
    //@Autowired //按照类型来注入
    @Resource(name="adminDaoI2") //按照资源名称来进行注入
    private AdminDao ad;


    @Override
    public boolean toLogin(Student s) {
        Student stu = ad.toLogin();
        if (stu.getLoginName().equals(s.getLoginName())
                && stu.getPassword().equals(s.getPassword())){
            return true;
        }
        return false;
    }
}
